home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
27
/
2
/
DISK2727.ZIP
/
SMUTIL.EXE
/
SAMPLE.C
< prev
next >
Wrap
Text File
|
1990-07-26
|
920b
|
49 lines
/*************************************************************************
* *
* SAMPLE.C *
* *
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
void main(int argc,char *argv[]);
void endgood(int,int,int);
int smplad(int,int);
int second_function(void);
int third_function(void);
void main(int argc,char *argv[])
{
int a,b,x;
if (argc<3)
{
printf("\nUseage: sample Num1 Num2\n");
endgood(2,a,b);
}
a=atoi(argv[1]);
b=atoi(argv[2]);
if ((x=second_function())==1)
if ((x=third_function())==1)
endgood(1,a,b);
else
endgood(2,a,b);
}
void endgood(int num,int a, int b)
{
if (num==1)
{
printf("\n%d + %d = %d",a,b,smplad(a,b));
printf("\nThis is a good Exit.\n");
exit(0);
}
else
{
printf("\nThis is a bad Exit.\n");
exit(0);
}
}